#ifndef POINT_H
#define POINT_H

#include <allegro5\allegro.h>
#include <allegro5\allegro_primitives.h>
#include <allegro5\allegro_image.h>
#include <math.h>

using namespace std;

class Point {
public:
	 double x;
	 double y;

	Point() : x(0), y(0) {};
	Point(int x, int y) : x(x), y(y) {};

	void normalize() {
		int length = sqrt(x*x + y*y);
		x = x/length;
		y = y/length;
	}

	float dist(Point p) {
		return sqrt(pow((x - p.x), 2) + pow((y - p.y), 2));
	}

	Point& operator =(const Point& p) {
		if(this == &p)
			return *this;
		x = p.x;
		y = p.y;
		return *this;
	}

	Point operator +(const Point& p) {
		return Point(x + p.x, y + p.y);
	}

	Point operator -(const Point& p) {
		return Point(x - p.x, y - p.y);
	}

	Point operator *(const int i) {
		return Point(x*i, y*i);
	}

	Point operator -(const int i) {
		return Point(x - i, y - i);
	}

	const bool operator ==(const Point& p) const {
		return x == p.x && y == p.y;
	}

	const bool operator !=(const Point& p) const {
		return x != p.x && y != p.y;
	}
};

struct bitmapImage {
	ALLEGRO_BITMAP* image;
	int sizeX;
	int sizeY;
	Point offset;
};

struct imageArray {
	bitmapImage* images;
	int arraySize;
};

struct mapCell {
	char base;
	char fringe;
	char object;
	bool walkable;

	short int cost;

	//0 - none
	//1 - swordsmen
	//2 - archer
	char entity;

	//true - player
	//false - computer
	bool team;
};

struct MapInfo{
	int tileSize;
	int numTilesX;
	int numTilesY;
};

#endif